<div class="grid50"><div class="rad">

<?php // print_r($init); ?>
<table class="grids">
  <thead>
    <tr>
      <th colspan="2">Informasi Wilayah</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Cluster</td>
      <td><strong><?php echo $region.' '.$cluster; ?></strong></td>
    </tr>
    <tr>
      <td>Maintained By</td>
      <td>
        <select class="select" id="maintained-by" name="maintaned_by">
          <option <?php if(!$init['territory']['user_id']) {echo 'selected="selected"';} ?> value="" >Unmaintained</option>
          <?php 
            foreach ($complement['sales_person'] as $key): 
              if($key->user_id == $init['territory']['user_id']) 
                { echo '<option value="'.$key->user_id.'" group="'.$key->user_group_caption.'" selected="selected">'.$key->user_group_caption.' | '.strtoupper($key->user_name).'</option>'; }
              else
                { echo '<option value="'.$key->user_id.'" group="'.$key->user_group_caption.'" >'.$key->user_group_caption.' | '.strtoupper($key->user_name).'</option>'; }
            endforeach 
          ?>
        </select>
      </td>
    </tr>
    <tr>
      <td>Outbond Caller</td>
      <td>
        <select class="select" id="outond-caller" name="outbond_caller">
          <option <?php if(!$init['outlet']['outbond_caller_id']) {echo 'selected="selected"';} ?> value="" >N/A</option>
          <?php 
            foreach ($complement['outbond_caller'] as $key): 
              if($key->user_id == $init['outlet']['outbond_caller_id']) 
                { echo '<option value="'.$key->user_id.'" group="'.$key->user_group_caption.'" selected="selected">'.$key->user_group_caption.' | '.strtoupper($key->user_name).'</option>'; }
              else
                { echo '<option value="'.$key->user_id.'" group="'.$key->user_group_caption.'" >'.$key->user_group_caption.' | '.strtoupper($key->user_name).'</option>'; }
            endforeach 
          ?>
        </select>
      </td>
    </tr>
  </tbody>
</table>

</div></div>

<div class="grid50"><div class="rad">

<table class="grids">
  <thead>
    <tr>
      <th colspan="2">Informasi Branding</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Tipe Bangunan</td>
      <td>
        <select name="outlet_building">
          <?php 
            foreach ($complement["outlet_type"] as $key) {
              if($key["field_val"] == $init["oData"]["outlet_building"]) 
                { echo '<option value="'.$key["field_key"].'" selected="selected">'.$key["field_val"].'</option>'; }
              else 
                { echo '<option value="'.$key["field_key"].'">'.$key["field_val"].'</option>'; }
            }
          ?>          
        </select>
      </td>
    </tr>
    <tr>
      <td>Status Brading Smart</td>
      <td>
        <input type="radio" name="status_branding" id="na"
            <?php if( $init['branding']['branding_status'] == 'N/A' )
                echo 'checked="checked"';
            ?> value="N/A"/> <label for="na">N/A</label>

        <input type="radio" name="status_branding" id="full"
            <?php if( $init['branding']['branding_status'] == 'Full' )
                echo 'checked="checked"';
            ?> value="Full"/> <label for="full" >Full</label>

        <input type="radio" name="status_branding" id="partial"
            <?php if( $init['branding']['branding_status'] == 'Partial' )
                echo 'checked="checked"';
            ?> value="Partial"/><label for="partial">Partial</label>
      </td>
    </tr>
    <tr>
      <td>Full Branding</td>
      <td>
        <select class="select" id="branding" name="full_branding_by">
          <?php 
            foreach ($complement['full_branding_by'] as $key) {
              if($key["field_key"] == $init['branding']["full_branding_by"])
                { echo '<option value="'.$key["field_key"].'" selected="selected" >'.$key["field_val"].'</option>'; }
              else 
                { echo '<option value="'.$key["field_key"].'">'.$key["field_val"].'</option>'; }
            }
          ?>
        </select>
      </td>
    </tr>
    <tr>
      <td>Akhir Kontrak</td>
      <td><input type="text" name="contract_end" class="datepicker" value="<?php echo $init["branding"]["contract_end"]; ?>" readonly="readonly" /></td>
    </tr>
    <tr>
      <td>Nilai Branding</td>
      <td>
        <input type="text" name="branding_value" value="<?php echo $init["branding"]["branding_value"]; ?>" class="small" /> <br/>
        Gunakan hanya angka, tanpa tanda koma ataupun titik. <br/>
        Contoh untuk satu juta rupiah => 1000000
      </td>
    </tr>
  </tbody>
</table>

</div></div>

<div class="clear"></div>